home *** CD-ROM | disk | FTP | other *** search
/ The Best of MacTutor - S…e Code for Volumes 1 to 5 / The Best of MacTutor - Source Code for Volume 1-5 (Wayzata Technology)(6031)(1990).bin / Source Code / #41 (Feb 89) / security code / CodeSizeLimits.p < prev    next >
Text File  |  1988-11-29  |  1KB  |  47 lines

  1. UNIT  CodeSizeLimits;
  2. {-------------------------------------------}
  3. (*
  4. ©1988 by Steve Seaquist. All rights reserved.
  5. Used by permission.  Use at your own risk.  
  6. No warranty is expressed or implied.  
  7.  
  8. This Macintosh virus-detecting program was 
  9. originally published and explained in the 
  10. February 1989 issue of MacTutor magazine.  
  11. Some aspects of its design are important to 
  12. security, and it uses some unusual 
  13. techniques, so please read the article.  
  14. *)
  15. {-------------------------------------------}
  16. INTERFACE
  17.  
  18. VAR
  19.   gJTSize:            INTEGER;
  20.   gEntryPoint:        LONGINT;
  21.   gSizeLimit:
  22.     ARRAY [0..8] OF   LONGINT;
  23.   gMaxCode:           INTEGER;
  24.  
  25. PROCEDURE  GetCodeSizeLimits;
  26.  
  27. {*******************************************}
  28. IMPLEMENTATION
  29. PROCEDURE  zzSecurityPatrol;        EXTERNAL;
  30. {-------------------------------------------}
  31. PROCEDURE  GetCodeSizeLimits;
  32. BEGIN
  33. gEntryPoint   := ORD4(@zzSecurityPatrol)+$1A;
  34. gJTSize       := 1240;
  35. gMaxCode      := 8;
  36. gSizeLimit[0] := gJTSize + 16;
  37. gSizeLimit[1] := 15700;
  38. gSizeLimit[2] := 23900;
  39. gSizeLimit[3] := 11200;
  40. gSizeLimit[4] := 00844;
  41. gSizeLimit[5] := 01908;
  42. gSizeLimit[6] := 01606;
  43. gSizeLimit[7] := 01822;
  44. gSizeLimit[8] := 01312;
  45. END;
  46. {*******************************************}
  47. END.